package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * tb_user的Po类
 * @author 阿伟
 * @date 2023/7/27 15:40
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class UserPo extends BasePo{

    private String username;

    private String password;

    private String name;

    private String email;

    private String mobile;

    public static void check(UserPo up) {
        if (up == null || up.username.isEmpty() || up.password.isEmpty() || up.name.isEmpty() || up.email.isEmpty() || up.mobile.isEmpty()) {
            throw new DataErrorException("数据异常:用户丢失");
        }
        BasePo.check(up);
    }


}
